package myky.com.doctorapp.adapter

import android.text.TextUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.facebook.drawee.view.SimpleDraweeView
import myky.com.doctorapp.R
import myky.com.doctorapp.utils.UriUtils

class FeedBackImageAdapter(pic:MutableList<String>):BaseQuickAdapter<String,BaseViewHolder>(R.layout.activity_bespeak_photo_item,pic) {
    override fun convert(helper: BaseViewHolder?, item: String?) {

        val simpleDraweeView = helper?.getView<SimpleDraweeView>(R.id.bespeak_photo_img)

        if(!TextUtils.isEmpty(item)){
            simpleDraweeView?.setImageURI(UriUtils.getUriInstance().getUri(item))

            helper?.setVisible(R.id.bespeak_deleteIcon,true)

        }else{
            simpleDraweeView?.setImageURI(UriUtils.getUriInstance().getUri(R.mipmap.zjzx_sctp_icon))

            helper?.setVisible(R.id.bespeak_deleteIcon,false)
        }



        helper?.addOnClickListener(R.id.bespeak_deleteIcon)

        helper?.addOnClickListener(R.id.bespeak_photo_img)


    }
}